import Layout from '@/view/component/layout/index';
import LoginLayout from '@/view/component/layout/LoginLayout';
import AdminLayout from '@/view/component/layout/adminLayout';
const homeRouter = {
    path: '/home',
    name: '_home',
    redirect: '/home',
    component: AdminLayout,
    meta: {
        hideInMenu: true,
        notCache: true
    },
    children: [
        {
            path: '/home',
            name: 'home',
            meta: {
                hideInMenu: true,
                title: '首页',
                notCache: true,
            },
          component: () => import('@/view/home/workbench-index.vue'),
        }
    ]
};
const baseRouter = {
    path: 'base',
    name: 'base-router',
    component: LoginLayout,
    meta: {
        hideInMenu: true,
        notCache: false
    },
    children: [
        {
            path: '/login',
            name: 'login',
            meta: {
                hideInMenu: true,
                notCache: true,
            },
            component: () => import('@/view/login/login.vue')
        },
        {
            path: '/register',
            name: 'register',
            meta: {
                hideInMenu: true,
                notCache: false,
            },
            component: () => import('@/view/register/register.vue')
        }
    ]
};

const view1 = {
    path: '/cmlLogin',
    name: 'cmlLogin',
    meta: {
        hideInMenu: true
    },
    component: () => import('@/view/home/cmlLogin.vue')
};

const page_401 = {
    path: '/401',
    name: 'error_401',
    meta: {
        hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
};
const page_501 = {
    path: '/500',
    name: 'error_500',
    meta: {
        hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
};
const page_404 = {
    path: '*',
    name: 'error_404',
    meta: {
        hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
};

export const appRouter = [
    require('./modules/adminIndex').default,
    require('./modules/order').default,
    require('./modules/goods').default,
    require('./modules/static').default,
    require('./modules/rateQuery').default,
  require('./modules/approve').default
];

export default [
    page_401,
    page_501,
    page_404,
    homeRouter,
    baseRouter,
    view1,
    ...appRouter
];
